<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
 <%@ page import="com.exam.business.*"%>
 <%@ page import="com.exam.domain.*"%>
<%Course[] couSet=Manager.GetAllCou();%>
<%String param=(String)request.getParameter("param"); %>

<script type="text/javascript">
function confirmDel()
{
	if(confirm("确定删除?"))
	{
		<%request.getSession().setAttribute("confirmDelCou","1"); %>
	}
}
</script>

<title>E-Exam</title>
</head>
<body>
<p><img src="e-exam.gif" width="680" height="170" /></p>
 <%request.getSession().setAttribute("couFromWhere","2"); %>
<table width="797" height="199" border="1">
  <tr>
    <td width="240">课程名</td>
    <td width="140">课程ID</td>
    <td width="240">授课教师</td>
    <td width="240">教师ID</td>
    <td width="240">开课年份</td>
    <td width="240">学期</td>
    <td width="144">修改</td>
    <td width="144">删除</td>
  </tr>
  <%for(int i=0;i<couSet.length;i++) {%>
  <form id="form1" name="form1" method="post" action="servlet/UpdateCouServlet" ><tr>
    <td><%=couSet[i].getC_name()%></td>
    <td><%=couSet[i].getC_id()%></td>
    <td><%=Manager.findInstructorById(couSet[i].getI_id()).getI_name()%></td>
     <td><%=couSet[i].getI_id()%></td>
    <td><%=couSet[i].getYear()%></td>
    <td><%=couSet[i].getSection()%></td>
    <td>    
        <input name="Submit" type="submit" value="修改" />
        <input type="hidden" name="UpdateID" value="<%=couSet[i].getC_id()%>" >
    </td>
  </form>
  
  <form id="form2" name="form2" method="post" action="servlet/DelCouServlet">
    <td>
      <input name="Submit" type="submit" value="删除"onclick="confirmDel();">
   	  <input type="hidden" name="delID" value="<%=couSet[i].getC_id()%>" >
    </td>
  </tr></form>
  <%} %>
</table>

<p><a href="admin_c.jsp">返回课程管理中心</a></p>
<script type="text/javascript">
	if(<%=param%>==6)	alert("修改成功！");
	if(<%=param%>==7)	alert("删除成功！");
</script>
</body>
</html>
